package com.chenyun.system.event;

import com.chenyun.common.vo.SessionUser;
import lombok.Data;
import org.springframework.context.ApplicationEvent;

/**
 * 登录成功事件
 *
 * @author: lonni
 * @CreateTime: 2023-12-12  20:28
 * @Description:
 */

public class LoginEvent extends ApplicationEvent {
    private SessionUser sessionUser;
    private boolean success;
    private String msg;

    public LoginEvent(Object source, SessionUser user) {
        super(source);
        this.sessionUser = user;
    }

    public LoginEvent(Object source, SessionUser sessionUser, boolean success, String msg) {
        super(source);
        this.sessionUser = sessionUser;
        this.success = success;
        this.msg = msg;
    }

    public SessionUser getSessionUser() {
        return sessionUser;
    }

    public boolean isSuccess() {
        return success;
    }

    public String getMsg() {
        return msg;
    }
}
